/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:	GlbCloud			*/
/*	Author:		gong_libin			*/
/*	Date:		2012_01_12			*/
/*	File:		MrShm.h				*/
/********************************************************/

#ifndef _MRSHM_H
#define	_MRSHM_H

#include "MrIpc.h"
#include <sys/shm.h>

class CMrShm : public CMrIpc
{
public:
	CMrShm();
	virtual ~CMrShm();

	int MrShmGetID();
	void MrShmDetach();
	void* MrShmGetShm();
	void* MrShmAttach();
	void MrShmPutID(int iID);
	void MrShmReset(ULONG ulSize);

	virtual void MrIpcDelete();
	virtual int MrIpcCreate(key_t iKey, ULONG ulSize);
	virtual void MrIpcSetKernel(ULONG ulMax, ULONG ulAll);

protected:
	void* m_pShm;

private:
	int m_iShm;

};

#endif /* _MRSHM_H */
